package ejb;

import java.util.List;

import javax.ejb.Stateless;

import dao.StudentsDao;
import entity.Students;

@Stateless
public class StudentsBean implements StudentsBeanRemote, StudentsBeanLocal {
	
	@Override
	public void insert(Students student) {
		StudentsDao.INSTANCE.save(student);
	}

	@Override
	public void update(Students student) {
		StudentsDao.INSTANCE.merge(student);
	}

	@Override
	public void delete(Students student) {
		StudentsDao.INSTANCE.delete(student);
	}

	@Override
	public void get(Long id) {
		StudentsDao.INSTANCE.findById(id);
	}

	@Override
	public List<Students> getAll() {
		return StudentsDao.INSTANCE.findAll();
	}
}
